extends StaticBody2D

@onready 
var animated_sprite_2d: AnimatedSprite2D = $AnimatedSprite2D
@onready
var collision_shape_2d: CollisionShape2D = $CollisionShape2D
@onready
var ineractable_compoent: IneractableCompoent = $IneractableCompoent


func _ready() -> void:
	ineractable_compoent.ineractable_activated.connect(on_ineractable_activated)
	ineractable_compoent.ineractable_deactivated.connect(on_ineractable_deactivated)
	collision_layer = 1
	
func on_ineractable_activated():
	animated_sprite_2d.play("open_door")
	collision_layer = 2
	print("activated")

func on_ineractable_deactivated():
	animated_sprite_2d.play("close_door")
	collision_layer = 1
	print("deactivated")
